<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<base href="${BaseContext }">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>添加更新员工</title>
<link href="${pageContext.request.contextPath}/css/bootstrap.min.css" rel="stylesheet">
<script src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/js/jquery.js"></script>
</head>
<body>

<nav class="navbar-inverse">
	<div class="container">
		<!-- Brand and toggle get grouped for better mobile display -->
		<div class="navbar-header">
			<a class="navbar-brand" href="#">宾馆客房管理系统 : </a>
		</div>
		<div class="collapse navbar-collapse"
			 id="bs-example-navbar-collapse-9">
			<ul class="nav navbar-nav">
				<li  ><a href="${pageContext.request.contextPath}/room/list.do">客房管理</a></li>
				<li ><a href="${pageContext.request.contextPath}/order/list.do">订单管理</a></li>
				<li ><a href="${pageContext.request.contextPath}/customer/list.do">客户管理</a></li>
				<li class="active"><a href="${pageContext.request.contextPath}/user/list.do">员工管理</a></li>
				<li ><a href="${pageContext.request.contextPath}/behind/Mouth.jsp">月营业额统计</a></li>
				<li ><a href="${pageContext.request.contextPath}/behind/Year.jsp">年营业额统计</a></li>
			</ul>
			<p class="navbar-text navbar-right">
				<span>${username}</span> <i class="glyphicon glyphicon-log-in" aria-hidden="true"></i>&nbsp;&nbsp;
				<a href="${pageContext.request.contextPath}/exit.do" class="navbar-link">退出</a>
			</p>
		</div>
	</div>
</nav>

<div class="jumbotron" style="padding-top: 55px;padding-bottom: 15px;">
		<div class="container">
			<c:if test="${empty user.id}">
				<h2>添加员工</h2>
			</c:if>
			<c:if test="${not empty user.id}">
				<h2>更新员工信息</h2>
			</c:if>
		</div>
	</div>


	<div class="container" style="margin-top: 20px;">

		<form id="form" class="form-horizontal" action="${pageContext.request.contextPath}/user/addUser.do?strId=${user.id}"
			method="post" enctype="multipart/form-data">
			<input value="${user.id}" name="id" type="hidden" >
			<div class="form-group">
				<label  class="col-sm-2 control-label">姓名</label>
				<div class="col-sm-10">
					<input type="text" class="form-control" name="name"
						 placeholder="姓名" value="${user.name}">
				</div>
			</div>
			<div class="form-group">
				<label  class="col-sm-2 control-label">电话</label>
				<div class="col-sm-10">
					<input type="text" class="form-control" name="tel"
						   placeholder="电话" value="${user.tel}">
				</div>
			</div>

			<div class="form-group">
				<label  class="col-sm-2 control-label">生日</label>
				<div class="col-sm-10">
					<input type="date" class="form-control" name="birthday"
						   placeholder="生日" value="${user.birthday}">
				</div>
			</div>

			<div class="form-group">
				<label  class="col-sm-2 control-label">年龄</label>
				<div class="col-sm-10">
					<input type="text" class="form-control" name="age"
						 placeholder="年龄" value="${user.age}">

				</div>
			</div>
			<div class="form-group">
				<label  class="col-sm-2 control-label">性别</label>
				<div class="col-sm-10">
					男<input type="radio" class="form-control" name="sex" value="男"
						   placeholder="性别" ${user.sex == "男"?"checked":""}>&nbsp;
					女<input type="radio" class="form-control" name="sex" value="女"
						   placeholder="性别"  ${user.sex == "女"?"checked":""}>

				</div>
			</div>
			<div class="form-group">
				<label  class="col-sm-2 control-label">身份证号码</label>
				<div class="col-sm-10">
					<input type="text" class="form-control" name="idcard"
						 placeholder="身份证号码" value="${user.idcard}">
				</div>
			</div>
			<div class="form-group">
				<label  class="col-sm-2 control-label">地址</label>
				<div class="col-sm-10">
					<input type="text" class="form-control" name="address"
						 placeholder="地址" value="${user.address}">
				</div>
			</div>

			<div class="form-group">
				<label class="col-sm-2 control-label">职位</label>
				<div class="col-sm-10">

					<select name="rId" class="form-control">
						<option value="4">普通员工</option>
						<option value="7">主管</option>
						<option value="2">经理</option>
						<option value="1">管理员</option>
						<option value="5" readonly>董事长</option >
						<option value="6" readonly="readonly">董事长秘书</option >
					</select>
				</div>
			</div>

			<div class="form-group">
				<div class="col-sm-offset-2 col-sm-10">
					<button type="submit" class="btn  btn-primary">保存</button>
					<a href="${pageContext.request.contextPath}/user/list.do" class="btn btn-default">返回列表</a>
				</div>
			</div>
		</form>

	</div>

</body>
</html>